package com.sjtu.rental.entity;

import java.util.Date;
import java.util.List;

/**
 * House entity. @author MyEclipse Persistence Tools
 */

@SuppressWarnings("serial")
public class House implements java.io.Serializable {

	// Fields

	private Long id;
	private String title;
	private String housingName;
	private String address;
	private String houseType;
	private Integer tenantNumber;
	private Double area;
	private Integer years;
	private Double price;
	private String picture;
	private String remark;
	private Long creator;
	private Integer isDeleted;
	private Integer district;
	private Date createDate;
	private Integer approveState;
	
	private Long appointmentCount; 
	private Integer marksum;
	private Integer markcount;
	
	public Integer getMarksum() {
		return marksum;
	}

	public void setMarksum(Integer marksum) {
		this.marksum = marksum;
	}

	public Integer getMarkcount() {
		return markcount;
	}

	public void setMarkcount(Integer markcount) {
		this.markcount = markcount;
	}

	public Long getAppointmentCount() {
		return appointmentCount;
	}

	public void setAppointmentCount(Long appointmentCount) {
		this.appointmentCount = appointmentCount;
	}

	private String creatorName;
	
	public String getCreatorName() {
		return creatorName;
	}

	public void setCreatorName(String creatorName) {
		this.creatorName = creatorName;
	}

	private List<HouseFile> houseFiles;

	public List<HouseFile> getHouseFiles() {
		return houseFiles;
	}

	public void setHouseFiles(List<HouseFile> houseFiles) {
		this.houseFiles = houseFiles;
	}

	public Integer getApproveState() {
		return approveState;
	}

	public void setApproveState(Integer approveState) {
		this.approveState = approveState;
	}

	private Integer room;
	private Integer hall;
	private Integer bathroom;
	private Integer floor;
	private Integer allFloor;

	// Constructors

	/** default constructor */
	public House() {
	}

	/** minimal constructor */
	public House(String title, String housingName, String address,
			String houseType, Double area, Double price, Long creator,
			Integer isDeleted, Date createDate) {
		this.title = title;
		this.housingName = housingName;
		this.address = address;
		this.houseType = houseType;
		this.area = area;
		this.price = price;
		this.creator = creator;
		this.isDeleted = isDeleted;
		this.createDate = createDate;
	}

	/** full constructor */
	public House(String title, String housingName, String address,
			String houseType, Integer tenantNumber, Double area, Integer years,
			Double price, String picture, String remark, Long creator,
			Integer isDeleted, Integer district, Date createDate) {
		this.title = title;
		this.housingName = housingName;
		this.address = address;
		this.houseType = houseType;
		this.tenantNumber = tenantNumber;
		this.area = area;
		this.years = years;
		this.price = price;
		this.picture = picture;
		this.remark = remark;
		this.creator = creator;
		this.isDeleted = isDeleted;
		this.district = district;
		this.createDate = createDate;
	}

	// Property accessors

	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getTitle() {
		return this.title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getHousingName() {
		return this.housingName;
	}

	public void setHousingName(String housingName) {
		this.housingName = housingName;
	}

	public String getAddress() {
		return this.address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getHouseType() {
		return this.houseType;
	}

	public void setHouseType(String houseType) {
		this.houseType = houseType;
	}

	public Integer getTenantNumber() {
		return this.tenantNumber;
	}

	public void setTenantNumber(Integer tenantNumber) {
		this.tenantNumber = tenantNumber;
	}

	public Double getArea() {
		return this.area;
	}

	public void setArea(Double area) {
		this.area = area;
	}

	public Integer getYears() {
		return this.years;
	}

	public void setYears(Integer years) {
		this.years = years;
	}

	public Double getPrice() {
		return this.price;
	}

	public void setPrice(Double price) {
		this.price = price;
	}

	public String getPicture() {
		return this.picture;
	}

	public void setPicture(String picture) {
		this.picture = picture;
	}

	public String getRemark() {
		return this.remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public Long getCreator() {
		return this.creator;
	}

	public void setCreator(Long creator) {
		this.creator = creator;
	}

	public Integer getIsDeleted() {
		return this.isDeleted;
	}

	public void setIsDeleted(Integer isDeleted) {
		this.isDeleted = isDeleted;
	}

	public Integer getDistrict() {
		return this.district;
	}

	public void setDistrict(Integer district) {
		this.district = district;
	}

	public Date getCreateDate() {
		return this.createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	public Integer getRoom() {
		try {
			return room == null ? Integer.parseInt(houseType.split("-")[0])
					: room;
		} catch (Exception e) {
			return null;
		}
	}

	public void setRoom(Integer room) {
		this.room = room;
	}

	public Integer getHall() {
		try {
			return hall == null ? Integer.parseInt(houseType.split("-")[1])
					: hall;
		} catch (Exception e) {
			return null;
		}
	}

	public void setHall(Integer hall) {
		this.hall = hall;
	}

	public Integer getBathroom() {
		try {
			return bathroom == null ? Integer.parseInt(houseType.split("-")[2])
					: bathroom;
		} catch (Exception e) {
			return null;
		}
	}

	public void setBathroom(Integer bathroom) {
		this.bathroom = bathroom;
	}

	public Integer getFloor() {
		try {
			return floor == null ? Integer.parseInt(houseType.split("-")[3])
					: floor;
		} catch (Exception e) {
			return null;
		}
	}

	public void setFloor(Integer floor) {
		this.floor = floor;
	}

	public Integer getAllFloor() {
		try {
			return allFloor == null ? Integer.parseInt(houseType.split("-")[4])
					: allFloor;
		} catch (Exception e) {
			return null;
		}
	}

	public void setAllFloor(Integer allFloor) {
		this.allFloor = allFloor;
	}

}